<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>手动同步进货验收</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="出库单工具">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/themes/gray/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/easyui/themes/icon.css">
<script type="text/javascript" src="<%=path%>/easyui/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/easyui/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path%>/easyui/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/easyui/js/con_isok.js"></script>

</head>
<body class="easyui-layout">

	<div data-options="region:'north',border:false" style="padding:2px;">
		<table align="">
			<tr>
				<td>时间:</td>
				<td><input id="time_id" class="easyui-datebox" data-options="editable:false"></td>
				<td align="center"><a id="select_btn" href="javascript:void(0);" class="easyui-linkbutton" onclick="sync1();">同步</a>
				</td>
			</tr>
		</table>
	</div>

	<script type="text/javascript">
		
		
		function start(){
			var value = $('#p').progressbar('getValue');
			if (value < 100){
				value += Math.floor(Math.random() * 2);
				$('#p').progressbar('setValue', value);
				setTimeout("start()", 300);
			}
		};
	
		$(function(){
			var myDate = new Date();
			var year = myDate.getFullYear();
			var month = myDate.getMonth() + 1;
			var day = myDate.getDate()-1;
			$("#time_id").datebox('setValue', year +"-"+ month + "-" + day);
		});
	
	
	
		function sync1(){
			isOkCon("", "<%=path%>","sync()");
		}
		
		function sync(){
			$.messager.progress({title: "提示", msg: "正在同步...", interval: 1000});
			var time = $("#time_id").datebox('getValue');
			//start();
			$.ajax({
				url: "<%=path%>/sync/manualSync.do",
				type : "post",
				data : {
					time : time
				},
				success : function(data) {
					$.messager.alert("提示", "同步完成!", "info");
				},
				error : function() {
					$.messager.alert("提示", "同步失败!", "error");
				},
				complete : function() {
					//$('#p').progressbar('setValue', 100);
					$.messager.progress('close');
				}
			});
		}
	</script>
</body>
</html>
